package entity

import (
	"gitee.com/linxing_3/sr-core/plugins/storage/database"
	"gitee.com/linxing_3/sr-core/yerr"
)

func AutoMigrate(dataset database.IDataSet) error {
	db, ok := dataset.UnLoggerDefault()
	if !ok {
		return yerr.ErrBizPluginNotFound.Errorf("database not found")
	}

	return db.AutoMigrate(
		&ModuleTable{},
		&ModuleField{},
	)
}
